x86 hvm: Do not overwrite boot-cpu capability data on VMX/SVM startup.
authorKeir Fraser <keir@xen.org>
Tue, 30 Nov 2010 11:34:08 +0000 (11:34 +0000)
committerKeir Fraser <keir@xen.org>
Tue, 30 Nov 2010 11:34:08 +0000 (11:34 +0000)
Apparently required back in the earliest days of Xen, we now properly
initialise CPU capabilities early during bootstrap. Re-writing
capability data later now causes problems if specific features have
been deliberately masked out.

Thanks to Weidong Han at Intel for finding such a bug where XSAVE
feature is masked out by default, but then erroneously written back
during VMX initialisation. This would cause memory corruption problems
during boot for XSAVE-capable systems.

Signed-off-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c

index a43bc728dcf31dd48d211e9e1a8cf43bb12d5cc1..aefaabc415ecd935c311198206ac3e5cc4ae93e2 100644 (file)
@@ -885,9 +885,6 @@ static int svm_cpu_up(void)
 
 struct hvm_function_table * __init start_svm(void)
 {
-    /* Xen does not fill x86_capability words except 0. */
-    boot_cpu_data.x86_capability[5] = cpuid_ecx(0x80000001);
-
     if ( !test_bit(X86_FEATURE_SVME, &boot_cpu_data.x86_capability) )
         return NULL;
 
index e24f0093e4b9bc432f6a5aae55921fe2de341497..2dd14b4fd7a3e42374cf2b6590343bf2cc43fce0 100644 (file)
@@ -1394,9 +1394,6 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
 
 struct hvm_function_table * __init start_vmx(void)
 {
-    /* Xen does not fill x86_capability words except 0. */
-    boot_cpu_data.x86_capability[4] = cpuid_ecx(1);
-
     if ( !test_bit(X86_FEATURE_VMXE, &boot_cpu_data.x86_capability) )
         return NULL;